$(document).ready(function()//When the dom is ready 
{
  $("#submitLogin").click(function()
	  
  {
	  var username = $("#user1").val();
	  var password = $("#pass1").val();
	  
	$.ajax({ 
		type: "POST",  
		url: "login.php",
		data: "username="+username+"&password="+password,
		success: function(server_response){  
   
			$("#login").ajaxComplete(function(event, request){ 

				if(server_response == '0')
				{ 
					$("#login").html('WELCOME, ' + username + '.');
				} 

			});
		});
   });
});
